package com.qf.utils;/*
*王浩政 
*随机数工具类
2022/8/18
10:55
*小米商城
*/

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class RandomUtils {
    //生成激活码
    public static String createActiveCode(){
        Random random=new Random();
        return getTime()+Integer.toHexString(random.nextInt(99999999));
    }
    public static  String getTime(){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmssSS");
        return sdf.format(new Date());
    }
    public static String createOrderId(){
        return getTime()+new Random().nextInt(99999999);
    }
}
